//
//  MTRedPacketModel.swift
//  MT
//
//  Created by 陈悦 on 2020/5/19.
//  Copyright © 2020 张强. All rights reserved.
//

import Foundation
import ObjectMapper
import MTCategory

class MTRedPacketReportModel: Mappable {
    
    /// 请求是否成功的code
    var code: Int?
    /// 请求返回的Message
    var message: String?
    /// 分页对象
    var page: PageModel?
    /// 时间戳
    var timestamp: TimeInterval?
    
    var giftSum: Int?
    
    var result: [MTRedPacketReportSubModel]?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        code    <- map["code"]
        message <- map["message"]
        page <- map["page"]
        timestamp <- map["timestamp"]
        result  <- map["result"]
        giftSum  <- map["giftSum"]
    }
}


class MTRedPacketReportSubModel: Mappable {
    
    var createTime: String?
    
    var money: Int = 0
    
    var state: Int = 0
    
    var nickname: String?
    
    var count: Int = 0
    
    var pullCount: Int = 0
    
    var typeName: String?
    
    var balanceAmount: Int = 0
    
    var amount: Int = 0
    
    var payAmount: Int = 0
    
    //1福利红包 2游戏红包 3每日红包 4聚会任务金
    var category: Int = 1
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        createTime  <- map["createTime"]
        money       <- map["money"]
        state       <- map["state"]
        nickname    <- map["nickname"]
        count       <- map["count"]
        pullCount   <- map["pullCount"]
        typeName    <- map["typeName"]
        balanceAmount <- map["balanceAmount"]
        amount      <- map["amount"]
        payAmount      <- map["payAmount"]
        category      <- map["category"]
    }
}
